import { request } from '@/utils/requestWrapper';

import type { API } from '@/backend/typings.d';

/** 添加分类 POST /api/category/add */
export async function addCategoryUsingPost(
  body: API.CategoryAddRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>({
    url: "/api/category/add",
    method: "POST",
    data: body,
    ...options
  });
}

/** 删除分类 POST /api/category/delete */
export async function deleteCategoryUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>({
    url: "/api/category/delete",
    method: "POST",
    data: body,
    ...options
  });
}

/** 获取分类详情 GET /api/category/get/vo */
export async function getCategoryVoByIdUsingGet(
  params: API.getCategoryVOByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseCategoryVO_>({
    url: "/api/category/get/vo",
    method: "GET",
    data: params,
    ...options
  });
}

/** 分页获取分类列表 POST /api/category/list/page/vo */
export async function listCategoryVoByPageUsingPost(params: any) {
  return request<API.BaseResponsePageCategoryVO_>({
    url: "/api/category/list/page/vo",
    method: "POST",
    data: params
  });
}

/** 更新分类 POST /api/category/update */
export async function updateCategoryUsingPost(
  body: API.CategoryUpdateRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>({
    url: "/api/category/update",
    method: "POST",
    data: body,
    ...options
  });
} 